<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ChildStar extends Model
{
    protected $fillable = ['child_id', 'history_id', 'last_history_id', 'code', 'category_id', 'grade_id', 'star', 'last_star', 'top_star_time','last_star_time'];

    public function child(){
        return $this->belongsTo(Child::class);
    }
    public function game(){
        return $this->belongsTo(Game::class, 'code', 'code');
    }
    public function category(){
        return $this->belongsTo(Category::class);
    }
    public function grade(){
        return $this->belongsTo(Grade::class);
    }
}
